//package hasthi.container;
//
//import hasthi.common.HasthiException;
//import hasthi.container.p2p.P2PMessageContext;
//
//import org.apache.xmlbeans.XmlObject;
//
//public class ContainerFactory {
//    public static enum ContainerType {
//        p2p, soap
//    };
//
//    public static MessageContext createMessageContext(XmlObject bodycontent, String toAddress,
//            String soapAction) throws HasthiException {
//        return new XSULMessageContext(bodycontent, toAddress, soapAction);
//
//    }
//
//    public static MessageContext createMessageContext(ContainerType type, XmlObject bodycontent,
//            String toAddress, String soapAction) throws HasthiException {
//        switch (type) {
//        case p2p:
//            return new P2PMessageContext(bodycontent, new NodeAddress(toAddress, null), soapAction);
//        default:
//            return new XSULMessageContext(bodycontent, toAddress, soapAction);
//        }
//    }
//
//    public static MessageContext createMessageContext(ContainerType type, XmlObject bodycontent,
//            NodeAddress toAddress, String soapAction) throws HasthiException {
//        switch (type) {
//        case p2p:
//            return new P2PMessageContext(bodycontent, toAddress, soapAction);
//        default:
//            return new XSULMessageContext(bodycontent, toAddress.getAddressAsString(), soapAction);
//        }
//    }
//}
